package flc.ast.fragment;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import flc.ast.R;
import flc.ast.activity.DrawActivity;
import flc.ast.activity.DrawTempActivity;
import flc.ast.databinding.FragmentDrawBinding;
import stark.common.basic.base.BaseNoModelFragment;
import stark.common.basic.event.EventStatProxy;

/**
 * A simple {@link Fragment} subclass.
 * Use the {@link DrawFragment#newInstance} factory method to
 * create an instance of this fragment.
 */
public class DrawFragment extends BaseNoModelFragment<FragmentDrawBinding> {


    @Override
    protected int onCreate() {
        return R.layout.fragment_draw;
    }

    @Override
    protected void initView() {
        EventStatProxy.getInstance().statEvent1(getActivity(), mDataBinding.event1Container);
        EventStatProxy.getInstance().statEvent5(getActivity(), mDataBinding.event5Container);

        mDataBinding.ivDraw.setOnClickListener(this);
        mDataBinding.llTemplate1.setOnClickListener(this);
        mDataBinding.llTemplate2.setOnClickListener(this);
        mDataBinding.llTemplate3.setOnClickListener(this);
    }

    @Override
    protected void onClickCallback(View v) {
        switch (v.getId()) {
            case R.id.ivDraw://立即创作
                DrawActivity.kind = 1;
                startActivity(DrawActivity.class);
                break;
            case R.id.llTemplate1://初级模板
                DrawTempActivity.type = 0;
                startActivity(DrawTempActivity.class);
                break;
            case R.id.llTemplate2://中级模板
                DrawTempActivity.type = 1;
                startActivity(DrawTempActivity.class);
                break;
            case R.id.llTemplate3://高级模板
                DrawTempActivity.type = 2;
                startActivity(DrawTempActivity.class);
                break;
        }
    }

    @Override
    protected void initData() {

    }
}